﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using DimsMapper.Modules;

namespace DimsMapper.Proto
{
    class Proto
    {
        public enum ItemTypes : int
        {
            None = -1,
            Armor,
			Container,
			Drug,
			Weapon,
			Ammo,
			Misc,
			Key
        }

        public enum SceneryTypes : int
        {
            Door,
			Stairs,
			Elevator,
			LadderUp,
			LadderDown,
			Generic
        }

        Common data;

        public Proto(Object.Types type, DBFile file)
        {
            switch (type)
            {
                case Object.Types.Item:
                    data = new Item(file);
                    break;
                case Object.Types.Critter:
                    data = new Critter(file);
                    break;
                case Object.Types.Scenery:
                    data = new Scenery(file);
                    break;
                case Object.Types.Walls:
                    data = new Wall(file);
                    break;
                case Object.Types.Tiles:
                    data = new Tile(file);
                    break;
                case Object.Types.Misc:
                    data = new Misc(file);
                    break;

                default:
                    break;
            }
        }
        
        public Common common
        {
            get { return data; }
        }

        public Item item
        {
            get { return (Item)data; }
        }

        public Critter critter
        {
            get { return (Critter)data; }
        }

        public Scenery scenery
        {
            get { return (Scenery)data; }
        }

        public Wall wall
        {
            get { return (Wall)data; }
        }

        public Tile tile
        {
            get { return (Tile)data; }
        }

        public Misc misc
        {
            get { return (Misc)data; }
        }
    }
}
